<template>
  <div class="my">
      <!-- 头像 -->
    <div class="top">
      <div class="top-hb">
        <div class="left">
          <div class="title">{{userInfo.nickname}}</div>
          <div class="sketch">{{userInfo.intro}}</div>
        </div>
        <img @click="$router.push('/home/myInfo')" v-if="userInfo.avatar"  class="right" :src="baseURL + userInfo.avatar" alt="" />
        <img   @click="$router.push('/home/myInfo')" v-else class="right" src="@/assets/login.jpg" alt="" />
      </div>
      <div class="top-bd">
        <ul class="data">
          <li class="data-item">
            <div class="num">298</div>
            <div class="answer">累计答题</div>
          </li>
          <li class="data-item">
            <div class="num">98</div>
            <div class="answer">收藏题目</div>
          </li>
          <li class="data-item">
            <div class="num">198</div>
            <div class="answer">我的错题</div>
          </li>
          <li class="data-item">
            <div class="num">79%</div>
            <div class="answer">正确率</div>
          </li>
        </ul>
      </div>
      <div class="position">
        <mycell title="我的岗位" value="产品经理" icon="&#xe64d;"></mycell>
      </div>
    </div>
    <!-- 面经数据  -->
    <div class="content">
      <div class="middle">
        <h3 class="middle-data">面经数据</h3>
        <ul class="total">
          <li class="total-item">
            <div class="txt">昨日阅读<span class='bule'>+300</span></div>
            <div class="num">17</div>
            <div class="read-total">阅读总数</div>
          </li>
          <li class="total-item">
            <div class="txt">昨日获赞<span class='bule'>+300</span></div>
            <div class="num">297</div>
            <div class="read-total">获赞总数</div>
          </li>
          <li class="total-item">
            <div class="txt">昨日评论 <span class='bule'>+12</span></div>
            <div class="num">187</div>
            <div class="read-total">评论总数</div>
          </li>
        </ul>
      </div>
        <!-- 分享 -->
        <div class="share">
            <mycell title='我的面经分享' value='21' icon="&#xe655;"></mycell>
            <mycell title='我的消息' value='98' icon="&#xe656;"></mycell>
            <mycell title='收藏的题库' value='32' icon="&#xe654;"></mycell>
            <mycell title='我的错题' value='132' icon="&#xe64f;"></mycell>
            <mycell title='收藏的面试经验' value='166' icon="&#xe649;"></mycell>
        </div>
    </div>
  </div>
</template>

<script>
import mycell from './mycell.vue'
import {mapState} from 'vuex'
export default {
  components: {
    mycell
  },
  data() {
    return {
      baseURL:process.env.VUE_APP_URL
    }
  },
  computed:{
    
      ...mapState(['userInfo'])
  },

}
</script>

<style lang="less" scoped>
.my {
    height: 100%;
  .top {
    position: relative;
    padding: 0 @p15;
    background: linear-gradient(45deg, #ce0031, #b8002c);
    .top-hb {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 50px @p15;
      .left {
        .title {
          font-size: 21px;
          font-family: PingFangSC, PingFangSC-Semibold;
          font-weight: 600;
          text-align: left;
          color: #ffffff;
          line-height: 30px;
          letter-spacing: 0px;
        }
        .sketch {
          opacity: 0.7;
          font-size: 14px;
          font-family: PingFangSC, PingFangSC-Regular;
          font-weight: 400;
          text-align: left;
          color: #ffffff;
          line-height: 16px;
          letter-spacing: 0px;
          padding-top: 8px;
        }
      }
      .right {
        width: 50px;
        height: 50px;
        border: 3px solid rgba(255, 255, 255, 0.38);
        border-radius: 50%;
      }
    }
    .top-bd {
      .data {
        display: flex;
        justify-content: space-around;
        align-items: center;
        .data-item {
          .num {
            font-size: 21px;
            font-family: PingFangSC, PingFangSC-Semibold;
            font-weight: 600;
            text-align: center;
            color: #ffffff;
            line-height: 30px;
            letter-spacing: 0px;
          }
          .answer {
            opacity: 0.7;
            font-size: 12px;
            font-family: PingFangSC, PingFangSC-Regular;
            font-weight: 400;
            text-align: center;
            color: #ffffff;
            line-height: 16px;
            letter-spacing: 0px;
          }
        }
      }
    }
    .position {
      position: relative;
      left: 0;
      bottom: -15px;
      width: 100%;

      .cell {
        border-radius: 8px 8px 0 0;
        width: 100%;
      }
    }
  }
  .content {
    background-color: #f7f4f5;
    height: 100%;
    padding: 10px @p15;
    .middle {
      background-color: #fff;
        padding: 10px;
        margin-top:15px;
      border-radius: 8px;
      .middle-data {
        font-size: 14px;
        font-family: PingFangSC, PingFangSC-Semibold;
        font-weight: 600;
        text-align: left;
        color: #181a39;
        line-height: 20px;
        letter-spacing: 0px;
      }
        .total {
          display: flex;
          justify-content: space-around;
          align-items: center;
          .total-item {
            .txt {
              font-size: 10px;
              font-family: PingFangSC, PingFangSC-Regular;
              font-weight: 400;
              text-align: center;
              color: #b4b4bd;
              line-height: 14px;
              letter-spacing: 0px;
              .bule{
                  color:#83ddea;
              }
            }
            .num {
              font-size: 21px;
              font-family: DINAlternate, DINAlternate-Bold;
              font-weight: 700;
              text-align: center;
              color: #181a39;
              line-height: 24px;
              letter-spacing: 0px;
            }
            .read-total {
              font-size: 12px;
              font-family: PingFangSC, PingFangSC-Regular;
              font-weight: 400;
              text-align: center;
              color: #545671;
              line-height: 16px;
              letter-spacing: 0px;
            }
          }
        }
    }
    .share {
        padding-top:10px;
    }
  }

}
</style>
